define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'mall.bond/index',
        add_url: 'mall.bond/add',
        edit_url: 'mall.bond/edit',
        export_url: 'mall.bond/export',
        modify_url: 'mall.bond/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                toolbar: ['refresh',
                    ],
                cols: [[
                    {type: "checkbox"},
                    {field: 'id', width: 80, title: 'ID'},
                    {field: 'title', width: 130, title: '商家名称',search: false},
                    {field: 'money', width: 120, title: '保证金金额'},
                    {field: 'paytime', width: 175, title: '支付时间', search: false},
                    {field: 'realname', width: 120, title: '申请人',},
                    {field: 'bankname', width: 150, title: '开户行',},
                    {field: 'bankno',width: 170, title: '银行卡号',},
                    {field: 'bzjstatus', title: '状态', width: 120, search: 'select', selectList: {0: '待申请', 1: '待审核', 2:'已返还', 3:'已拒绝'}},
                    {field: 'bzj_reason', width: 200, title: '审核意见', search: false},
                    {field: 'create_time', width: 170, title: '创建时间', search: 'range'},
                    {
                        width: 175,
                        title: '操作',
                        templet: ea.table.tool,
                        operat: [
                            [{
                                text: '确认返还',
                                url: init.edit_url,
                                method: 'open',
                                auth: 'edit',
                                class: 'layui-btn layui-btn-xs layui-btn-success',
                                extend: 'data-full="true"',
                                show:[
                                    {"name":"bzjstatus","value":"1"}
                                ]
                            },
                            ],
                        ]
                    }
                ]],
            });
            ea.listen();
        },
        edit:function (){
            ea.listen();
        }
    };
    return Controller;
});